<?php
require("config.php");
require("checkout_script.php");


//start session
session_start();

$sql = mysql_query ("SELECT id FROM customers WHERE u_name='".$_SESSION['customer']."';");
$row = mysql_fetch_assoc($sql);

$insert = "INSERT INTO invoices (customers_id, card_type, card_name, card_num, card_exp, total)
		VALUES ('".$row['id']."', '".$_POST['card']."', '".$_POST['card_name']."', '".$_POST['card_num1'].$_POST['card_num2'].$_POST['card_num3'].$_POST['card_num4']."', '".$_POST['month'].$_POST['year']."', '".$priceTotal."')";
$add_invoice = mysql_query($insert);


$cartArticles = "";
$cartTotal = "";



header('location: ../payment.php');
exit();

?>